#ifndef GAMEOBJECTMANAGER_H
#define GAMEOBJECTMANAGER_H

#include "Map.h"

class GameObject;
class Movable;

// Manager to add and remove gameobjects from the gameloop.
class GameObjectManager
{
public:
	static GameObjectManager* getInstance();
	static void destroyInstance();

	void update();
	void registerMovable(Movable* movable);
	void registerObjectForDeletion(GameObject* gameObject);

	void setMap(Map* map);
private:
	static GameObjectManager* gameObjectManager;

	GameObjectManager();

	typedef std::vector<GameObject*> GameObjects;
	typedef std::vector<Movable*> Movables;
	Movables movables; // Includes players.
	Movables movablesToAdd;
	GameObjects gameObjectsToDelete;

	Map* map;
};

#endif
